package outoforder.leetcode;

/**
 * @author shhjiang_001
 * @create 2020-07-02 13:16
 */
public class Demo3 {
    public static void main(String[] args) {
        int[][] vec = new int[][]{{1,2,3,4,5},{1,2,3,4,5},{1,2,3,4,5},{1,2,3,4,5},{1,2,3,4,5}};

        //左下-右上方向 从中间开始 向右下方遍历
        //i 代表的是步长 j代表是中间的斜轴
        for(int i = 0;i < vec.length;i++){
                 for(int j = 0;j < vec.length;j++){
                         if(j+i >= vec.length) break;
                        System.out.print(vec[j][j+i] + " ");
                     }
                System.out.println();
            }
    }
}
